package com.mediatek.settings.ext;

import com.android.mtksettingslib.wifi.AccessPoint;
import com.android.wifitrackerlib.WifiPickerTracker;

import android.content.ContentResolver;
import android.net.NetworkInfo.DetailedState;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;

import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceCategory;

import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;

public interface IWifiSettingsExt {

    /**
     * update the context menu for the current selected access point
     * @internal
     */
    void updateContextMenu(ContextMenu menu, int menuId, Preference preference);
    /**
     * Remove all prefereces in every catogory
     * @param screen The parent screen
     * @internal
     */
    void emptyCategory(PreferenceScreen screen);

    /**
     * Disconnect current connected access point
     * @param item The MenuItem
     * @param networkId The network id of the access point
     * @return true if CMCC item id is MENU_ID_DISCONNECT
     * @internal
     */
    boolean disconnect(MenuItem item, WifiConfiguration wifiConfig);

    /**
     * add all accessPoints to screen
     * @param screen The current screen
     * @param preferenceCategory google default preference Category
     * @param preference the current AccessPoint
     * @param isConfiged:true or false; false:  newCategory; true: add to common screen
     * @internal
     */
    void addPreference(PreferenceScreen screen,
            PreferenceCategory preferenceCategory, Preference preference, boolean isConfiged);

    /**
     * add all Category to screen
     * @param screen The current screen
     * @internal
     */
    void init(PreferenceScreen screen);

    /**
     * add all Category to screen
     * @param screen The current screen
     * @param Object WifiSettings2
     */
    void init(PreferenceScreen screen, Object objectWifiSettings2);

    /**
     * remove google default connection wifi.
     * default return false.
     * cmcc return true.
     */
    boolean removeConnectedAccessPointPreference();

    /**
     * customer add refresh button.
     * @param screen for find the additional_settings PreferenceCategory.
     * @param wifiTracker , WifiTracker is on or off.
     * @param isUiRestricted, If the user is not allowed to configure wifi,
     *  do not show the menu.
     */
    void addRefreshPreference(PreferenceScreen screen,
            Object wifiTracker,
            boolean isUiRestricted);

    /**
     * customer refresh button click.
     * CMCC and CT will be return true,
     * other return false.
     * @param preference refreshbutton.
     * @return true if CMCC or CT opeator.
     */
    boolean customRefreshButtonClick(Preference preference);

    /**
     * customer refresh button status
     * @param checkStatus checked or not.
     */
    void customRefreshButtonStatus(boolean checkStatus);

    /**
     * add modify menu on connect wifi preference
     * @param isSaved
     * @return isSaved if CMCC, return false if OM load
     */
    boolean addModifyMenu(boolean isSaved);

    /**
     * for common wifi settings use WifiSettings2.java
     * customer china mobile wifi settings UI requirement.
     */
    void customeAddOpWifiUI(PreferenceScreen preferenceScreen,
            WifiPickerTracker wifiPickerTracker,
            PreferenceCategory connectWifiPreferenceCategory,
            PreferenceCategory wifiPreferenceCategory,
            Preference preference);

    void customeAddWifiNetworkPreference(PreferenceCategory wifiPreferenceCategory,
            Preference preference);

    void customeAddWifiNetworkPreferenceOrder(Preference preference, int order);

    void addRefreshPreference(PreferenceScreen screen,
            boolean isWifiStateEnable,
            boolean isUiRestricted);

    /**
     * customer refresh button click.
     * CMCC and CT will be return true,
     * other return false.
     * @param preference refreshbutton.
     * @param bollean , true means use WifiSettings2.java, not WifiSetting.java
     * @return true if CMCC or CT opeator.
     */
    boolean customRefreshButtonClick(Preference preference, boolean isWifiSettings2);

    /**
     * custome menu, google aosp no modify menu for connect wifi
     * @param isDisconnect true if wifi can disconnect
     * @return default return false
     */
    boolean customeMenu(boolean isDisconnect);
}
